package edu.sctu.nieyu.day20150606.trainsystem;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * Created by user01 on 2015/6/9.
 */
public class TimeUitl {

    Passenger passenger0 = new PassengerData().passengerData().get(0);
    Passenger passenger1 = new PassengerData().passengerData().get(1);
    Passenger passenger2 = new PassengerData().passengerData().get(2);

//    private Passenger Passenger;
//
//    public TimeUitl(Passenger Passenger){
//        this.Passenger = Passenger;
//    }

    public void timeMessage(){


//        GregorianCalendar gc = new GregorianCalendar();
//        GregorianCalendar gc1 = new GregorianCalendar();
//        gc.set(2015, 5, 8, 17, 00);
//        gc1.set(2015,5,8,19,00);
//        String a = new SimpleDateFormat("yyyy-MM-dd hh:mm").format(gc.getTime());
//        String a1 = new SimpleDateFormat("yyyy-MM-dd hh:mm").format(gc1.getTime());
//        passenger0.setStartTime(a);
//        passenger0.setEndTime(a1);
//        System.out.println(passenger0.getName() + "进站时间："+passenger0.getStartTime());
//        System.out.println(passenger0.getName() + "出站时间："+passenger0.getEndTime());

        String time = "2015-5-8 17:05:01";
        SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        Date date = null;
        try{
            date = simple.parse(time);
        }catch (ParseException e){
            e.printStackTrace();
        }
        System.out.println(simple.format(date));







    }
}
